package com.shopnight.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName shop_order
 */
@TableName(value ="shop_order")
@Data
public class ShopOrder implements Serializable {
    /**
     * 商品id
     */
    @TableId(type = IdType.AUTO)
    private Long orderId;

    /**
     * 商品名字
     */
    private String orderName;

    /**
     * 商品描述
     */
    private String orderDescribed;

    /**
     * 分类id
     */
    private Integer catelogId;

    /**
     * 原价
     */
    private BigDecimal price;

    /**
     * 优惠价
     */
    private BigDecimal priceDiscounts;

    /**
     * 秒杀价格
     */
    private BigDecimal priceSeckill;

    /**
     * 成本价格
     */
    private BigDecimal priceCost;

    /**
     * 销量
     */
    private Long saleCount;

    /**
     * 秒杀标记   [0为普通商品,1为秒杀商品]
     */
    private Integer seckill;

    /**
     * 显示状态[0-不显示；1-显示]
     */
    private Integer showStatus;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 组织id
     */
    private Long orgId;

    /**
     * 逻辑删除（0删除 1正常）
     */
    @TableLogic
    private Integer tombstone;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ShopOrder other = (ShopOrder) that;
        return (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getOrderName() == null ? other.getOrderName() == null : this.getOrderName().equals(other.getOrderName()))
            && (this.getOrderDescribed() == null ? other.getOrderDescribed() == null : this.getOrderDescribed().equals(other.getOrderDescribed()))
            && (this.getCatelogId() == null ? other.getCatelogId() == null : this.getCatelogId().equals(other.getCatelogId()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getPriceDiscounts() == null ? other.getPriceDiscounts() == null : this.getPriceDiscounts().equals(other.getPriceDiscounts()))
            && (this.getPriceSeckill() == null ? other.getPriceSeckill() == null : this.getPriceSeckill().equals(other.getPriceSeckill()))
            && (this.getPriceCost() == null ? other.getPriceCost() == null : this.getPriceCost().equals(other.getPriceCost()))
            && (this.getSaleCount() == null ? other.getSaleCount() == null : this.getSaleCount().equals(other.getSaleCount()))
            && (this.getSeckill() == null ? other.getSeckill() == null : this.getSeckill().equals(other.getSeckill()))
            && (this.getShowStatus() == null ? other.getShowStatus() == null : this.getShowStatus().equals(other.getShowStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getOrgId() == null ? other.getOrgId() == null : this.getOrgId().equals(other.getOrgId()))
            && (this.getTombstone() == null ? other.getTombstone() == null : this.getTombstone().equals(other.getTombstone()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getOrderName() == null) ? 0 : getOrderName().hashCode());
        result = prime * result + ((getOrderDescribed() == null) ? 0 : getOrderDescribed().hashCode());
        result = prime * result + ((getCatelogId() == null) ? 0 : getCatelogId().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getPriceDiscounts() == null) ? 0 : getPriceDiscounts().hashCode());
        result = prime * result + ((getPriceSeckill() == null) ? 0 : getPriceSeckill().hashCode());
        result = prime * result + ((getPriceCost() == null) ? 0 : getPriceCost().hashCode());
        result = prime * result + ((getSaleCount() == null) ? 0 : getSaleCount().hashCode());
        result = prime * result + ((getSeckill() == null) ? 0 : getSeckill().hashCode());
        result = prime * result + ((getShowStatus() == null) ? 0 : getShowStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getOrgId() == null) ? 0 : getOrgId().hashCode());
        result = prime * result + ((getTombstone() == null) ? 0 : getTombstone().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", orderId=").append(orderId);
        sb.append(", orderName=").append(orderName);
        sb.append(", orderDescribed=").append(orderDescribed);
        sb.append(", catelogId=").append(catelogId);
        sb.append(", price=").append(price);
        sb.append(", priceDiscounts=").append(priceDiscounts);
        sb.append(", priceSeckill=").append(priceSeckill);
        sb.append(", priceCost=").append(priceCost);
        sb.append(", saleCount=").append(saleCount);
        sb.append(", seckill=").append(seckill);
        sb.append(", showStatus=").append(showStatus);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", orgId=").append(orgId);
        sb.append(", tombstone=").append(tombstone);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}